<!--
 * @Author: zi.yang
 * @Date: 2021-03-27 23:54:28
 * @LastEditors: zi.yang
 * @LastEditTime: 2021-03-28 00:02:49
 * @Description: In User Settings Edit
 * @FilePath: \My-JavaScript-Study\Vue Study\Vue原生\105、2021的重学14.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
 <script src="./vue.js"></script>
</head>
<body>
  <!-- 作用域插槽 -->
  <div id="app">
    <child>
      <template slot-scope="props">
        <h1>{{ props.item }}</h1>
      </template>
    </child>
  </div>

  <script>
    Vue.component('child',{
      data(){
        return {
          list:[1,2,3,4,5,6]
        }
      },
      template:`<div>
                  <ul>
                    <slot v-for="item in list" :item=item></slot>  
                  </ul>
                </div>`
    });

    new Vue({
      el:"#app",
    })
  </script>
</body>
</html>